package cn.wolfcode.wolf2w.util;

import lombok.Getter;

@Getter
public enum RedisKeys {
    //短信验证码
    VERIFY_CODE("verify_code", 60 * 5L),
    //登录token
    LOGIN_TOKEN("user_login_token", 60 * 30L),
    // 数据统计
    STRATEGY_STATIS_VO("strategy_statis_vo" , -1L),
    // 收藏统计
    USER_FAVOR("user_favor" , -1L),
    // 顶赞统计
    STRATEGY_THUMP("strategy_thump" , -1L);



    private String prefix;
    private Long time;

    private RedisKeys(String prefix, Long time){
        this.prefix = prefix;
        this.time = time;
    }
    public String join(String ...keys){
        StringBuilder sb = new StringBuilder();

        sb.append(prefix);
        for (String key : keys) {
            sb.append(":").append(key);
        }
        return sb.toString();
    }
}
